<!DOCTYPE html>
<html lang="">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no,viewport-fit=cover">
    <script type="text/javascript">
      // 判定机型
      var u = navigator.userAgent;
      var ua = navigator.userAgent.toLowerCase(); //微信小程序 
      var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android终端
      var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
      window.isAndroid = isAndroid;
      window.isiOS = isiOS;
       window.userToken =
      "eJwtzF0LgjAYBeD-sttCNnU5hW6K6qKC0ErsbrI5XvKLbZgR-fdMvTzPOZwPup4Sp5MaRch1MFqOGYSsLRQwMhcV1GCs5rbR88CIJ29bECgiPsYe8xilUyP7FrQcnFLqYowntVD9bUX8kAQ*ndWAGv6D9HVc5LHqC5GUe9g*4nTD7pfQJPm7czOVs4O6kaY8l7s1*v4AX241Gg__"
      window.user_id = 681; 
    //  window.userToken =
    //    "eJyrVgrxCdYrSy1SslIy0jNQ0gHzM1NS80oy0zLBwuYGxkbmxuZQqeKU7MSCgswUJStDEwMDU0NLSwsjiExqRUFmUSpQ3NTU1MjAwAAiWpKZCxIzM7E0MjKxMDWHmpKZDjTZOc9AOzIgNyDRMkY-tNw9PTI439HMID3C0bnKtSrLMbTQySPYv8JNO0bfyTvSVqkWAEGCMMM_"
    //  window.user_id = 14969
  
  
  
      if (ua.match(/MicroMessenger/i) == "micromessenger") {
         window.isWeixin = true;
        let str = window.location.href;
        let GetRequest_ = GetRequest(str)
        console.log("微信浏览器网址及参数:", str);
        if (window.user_id) {
          window.user_id = GetRequest_.user_id;
          window.userToken = GetRequest_.userToken;
          window.code = GetRequest_.code;
        }
  
        function GetRequest(urlStr) { //两种方式，输入链接获取或当前链接获取
          if (typeof urlStr == "undefined") {
            var url = decodeURI(location.search); //获取url中"?"符后的字符串
          } else {
            var url = "?" + urlStr.split("?")[1];
          }
          var theRequest = new Object();
          if (url.indexOf("?") != -1) {
            var str = url.substr(1); //去掉问号，问号为第一个字符
            var strs = [];
            strs = str.split("&");
            for (var i = 0; i < strs.length; i++) {
              theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
            }
           
          }
          return theRequest;
        }
      } else {
        if (window.isAndroid) {
          console.log('isAndroid');
          var info = window.app.getUserId();
          var token_1 = window.app.getUserToken()
          window.user_id = info;
          window.userToken = token_1;
        }
        if (window.isiOS) {
  
          window.webkit.messageHandlers.getUserId.postMessage({});
          window.webkit.messageHandlers.getUserToken.postMessage({});
  
          function sendKey(user_id) {
            window.user_id = user_id;
          }
  
          function sendToken(token11) {
            window.userToken = token11;
          }
        }
      }
    </script>
  </head>
  <body>
    <noscript>
      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <script src="//s1.yy.com/ued_web_static/lib/jszip/3.1.4/??jszip.min.js,jszip-utils.min.js" charset="utf-8"></script>
    <!-- built files will be auto injected -->
  </body>
</html>
